package cn.iocoder.yudao.module.written.exam.dal.redis;

/**
 * 缓存Key相关工具类
 */
public class CacheKeyUtil {

    /**
     * 冒号连接符
     */
    private static final String COLON = ":";

    /**
     * 统一前缀
     */
    public static final String CACHE_KEY_PREFIX = "offerbiye";

    public static final String KEY_WRITTEN_EXAM_SETTING = "examSetting";

    public static String HASH_KEY_WRITTEN_EXAM_TYPE_CODE = "examTypeCode";
    public static String HASH_KEY_JOB_CATEGORIES_ID = "jobCategoriesId";
    public static String HASH_KEY_EXPERT_ID = "expertId";
    public static String HASH_KEY_QUESTION_TYPE_CODE = "questionTypeCode";
    public static String HASH_KEY_FORCE_SCROLL = "forceScroll";
    public static String HASH_KEY_TWO_COLUMN_MODE = "twoColumnMode";
    public static String HASH_KEY_CODE_DETAIL_COMMENTS = "codeDetailComments";
    public static String HASH_KEY_CONTEXT_ANALYSIS = "contextAnalysis";
    public static String HASH_KEY_PLAY_ANSWER = "playAnswer";
    public static String HASH_KEY_PROGRAM_LANGUAGE = "programLanguage";

    /**
     * 获取笔试设置key
     *
     * @param userId
     * @return
     */
    public static String getWrittenExamSettingKey(Long userId) {
        return new StringBuilder(CACHE_KEY_PREFIX)
                .append(COLON)
                .append(KEY_WRITTEN_EXAM_SETTING)
                .append(COLON)
                .append(userId)
                .toString();
    }

}
